home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / kiss-0.11 / kiss-0 / kiss / src / dorecall.c < prev    next >
C/C++ Source or Header  |  1995-03-23  |  507b  |  25 lines

  1. #include "kiss.h"
  2.  
  3. int dorecall (Stringstack s)
  4. {
  5.     register int
  6.     j,
  7.     i;
  8.     
  9.     if (s.nstr != 2)
  10.     error ("recall command needs one argument");
  11.  
  12.     for (i = nhislist - 1; i >= 0; i--)
  13.     if (! strncmp (s.str [1], hislist [i].str [0], strlen (s.str [1])))
  14.     {
  15.         for (j = 0; j < hislist [i].nstr; j++)
  16.         printf ("%s ", hislist [i].str [j]);
  17.         putchar ('\n');
  18.         runcmd (hislist [i]);
  19.         return (laststatus);
  20.     }
  21.  
  22.     return (warning ("\"%s\": no such command in history list",
  23.              s.str [1]));
  24. }
  25.